﻿

<div class="@Class">
    @if (string.IsNullOrWhiteSpace(Title) == false)
    {
        <SectionTitleCard Title="@Title" />
    }
    <MRow>
        @foreach(var item in Model)
        {
            <MCol Cols="12" Md="6" Lg="4">
                <CnGalWebSite.Components.Inputs.MasaAutoComplete @bind-Value="@item.DisplayName" Label="唯一名称" AutoCompleteItems="AutoCompleteItems" />
            </MCol>
        }
    </MRow>
    <CnGalWebSite.Components.Buttons.MasaButton Rounded Text="添加" OnClick="OnAddinfor" Icon="mdi-plus"/>
</div>

@code {
    [Parameter]
    public List<RelevancesModel> Model { get; set; }
    [Parameter]
    public List<string> AutoCompleteItems { get; set; }
    [Parameter]
    public string Class { get; set; }


    [Parameter]
    public string Title { get; set; }

    private void OnAddinfor()
    {
        Model.Add(new RelevancesModel());   
    }

}
